var domain = "https://ball.wbball.com";

var ajax = (url, data, callback) => {
    fetch(url, {
        method: 'POST',
        headers: {'content-type': 'application/json'},
        body: JSON.stringify(data),
        cache: 'no-cache',
        credentials: 'same-origin',
        //mode: 'cors',
    }).then(res => {
        return res.status==200 ? res.json() : {code:0, msg: "服务器返回数据异常"}
    }, err=> {
        return {code:0, msg: "接口请求异常"};
    }).then(res => {
        callback(res)
    })
}